<template>
    <div class="storeInfo">
        <div class="storeInfo-part">
            <h4>基本信息</h4>
            <div class="storeInfo-container">
                <ul>
                    <li v-for="(item,index) in part1" :key="index">
                        <span class="thename">{{item}}:</span>
                        <span class="theinfo">{{info1[index]}}</span>
                    </li>
                </ul>
                <ul>
                    <li v-for="(item,index) in part2" :key="index">
                        <span class="thename">{{item}}:</span>
                        <span class="theinfo" v-html='info2[index]'></span>
                    </li>
                </ul>
            </div>
        </div>
        <!-- 员工提成的设置 -->
        <div class="storeInfo-part"> 
            <h4><span>员工提成信息</span><el-button type="primary" style="float:right">设置</el-button></h4>
            <div class="storeInfo-container">
                <ul>
                    <li><h5>普通酒水提成规则</h5></li>
                    <li><span class="thename">按照酒水消费金额的百分比: </span><span class="theinfo">5%</span></li>
                    <li><span class="thename">酒水消费金额*提成百分比</span></li>
                    <li><h5>VIP全国卡提成设置及规则</h5></li>
                    <li><span class="thename">售卡提成比例： </span><span class="theinfo">5%</span></li>
                    <li><span class="thename">到店消费使用VIP卡，折扣后金额记录在场次统计中，享受批次提成</span></li>
                    <li><h5>单店卡提成设置及规则</h5></li>
                    <li><span class="thename">售卡提成比例：  </span><span class="theinfo">5%</span></li>
                    <li><span class="thename">到店消费使用单店卡，消费金额不再记录在场次统计中，不再享受批次提成</span></li>
                </ul>
            </div>
        </div>

        <div class="storeInfo-part">
            <h4>签约信息</h4>
            <div class="storeInfo-container">               
                <ul>
                    <li><h5>魅平台费用</h5></li>
                    <li v-for="(item,index) in part3" :key="index">
                        <span class="thename">{{item}}:</span>
                        <span class="theinfo">{{info3[index]}}</span>
                    </li>
                </ul>
                <ul>
                    <li><h5>支付平台费率</h5></li>
                    <li v-for="(item,index) in part4" :key="index">
                        <span class="thename">{{item}}:</span>
                        <span class="theinfo">{{info4[index]}}</span>
                    </li>
                </ul>
            </div>
            <div class="storeInfo-container">               
                <ul class="hasBorder">
                    <li><h5>个人商家支付方式支持</h5></li>
                    <li v-for="(item,index) in part5" :key="index">
                        <span class="thename">{{item}}:</span>
                        <span class="theinfo">{{info5[index]}}</span>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</template>
<style lang="scss" scoped>
    .storeInfo{
        padding:10px;
        .storeInfo-part{
            width: 100%;
            background: #fff;
            border-radius: 6px;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
            overflow: hidden;
            margin: 15px 0;
            h4{
                background: rgb(244, 246, 250);
                font-size:16px;
                font-weight: bold;
                line-height: 40px;
                padding-left:15px;
            }
            .storeInfo-container{
                display: flex;
                ul{
                    padding:20px;
                    flex:1;                   
                    li{
                        font-size:14px;
                        line-height: 34px;
                        .thename{
                            color:rgba(0, 0, 0, 0.5)
                        }
                        .theinfo{
                            color: #000;
                        }
                        h5{
                            font-weight: bold
                        }
                    }
                }
                .hasBorder{
                    border-top:1px solid #ccc;
                }
            }
        }
    }
</style>
<script>
import {abc}  from "../../../../js/abc.js"
import {potUrl} from '../../../../js/config_url.js';
export default {
    data(){
        return {
            part1:[
               "门店名称", "门店属性","门店ID","门店编号","是否可预定","营业状态","营业时间","客服电话"
            ],
            part2:[
                "自动开机时间","提成基准金额","员工提成梯度一","提成信息梯度二","默认打印机","默认空调开机模式","开房是否开启空调","网络运营商",
            ],
            info1:[],
            info2:[],
            part3:[
               "魅品牌使用费", "魅KTV服务管理费","基础市场费用分摊","中央娱乐系统使用费","魅KTV VIP卡充值返利比例"
            ],
            part4:[
                "微信支付费率","支付宝支付费率","美团点评团购佣金","美团点评预定平台费","美团点评预定佣金","口碑商户佣金"
            ],
            info3:[],
            info4:[],
            part5:["是否支持个人支付宝（Alipay）","是否支持个人口碑","是否支持个人美团"],
            info5:[]
            
        }
        
    },
    mounted(){
        var that = this;
        if(abc.getSession('token') != null && abc.getSession('token') != '' && abc.getSession('token') != undefined){
            abc.get(that,potUrl.storeInfo,{store_info_id: abc.getSession('store_id'),type: 'store_info'},function(res){
                console.log(res)
                var storeInfo = res.data;
                that.info1=[
                    storeInfo.title,
                    storeInfo.store_type_cn,
                    storeInfo.store_id,
                    storeInfo.store_key,
                    storeInfo.is_reserve,
                    storeInfo.business_type_cn,
                    storeInfo.business_time,
                    storeInfo.telephone]
                var mode='',conditioning='',operator='',support_person_ali='',support_person_koubei=''
                storeInfo.air_condictioning_mode==2?mode='制热':mode='制冷';
                storeInfo.auto_open_air_conditioning==1?conditioning='是':conditioning='否';
                storeInfo.network_operator == ''?operator='--':operator=storeInfo.network_operator;
                storeInfo.percentage_combo_name = '按照对应档位<i style="color:red"> '+storeInfo.percentage_combo_name+' </i>的价格进行提成'
                that.info2=[
                    storeInfo.open_computer_time,
                    storeInfo.percentage_combo_name,
                    storeInfo.first_step_percent_cn,
                    storeInfo.second_step_percent_cn,
                    storeInfo.default_print_ip,
                    mode,
                    conditioning,
                    operator]
                that.info3=[
                    storeInfo.brand_fee_percentage_cn,
                    storeInfo.serve_manage_fee_percentage_cn,
                    storeInfo.base_market_fee_percentage_cn,
                    storeInfo.system_use_fee_cn,
                    storeInfo.vip_order_rebate]
                that.info4=[
                    storeInfo.wechat_fee_percentage,
                    storeInfo.ali_pay_percentage,
                    storeInfo.meituan_tuangou_commission_percentage,
                    storeInfo.meituan_fee_price_cn,
                    storeInfo.meituan_reserve_commission_percentage,
                    storeInfo.koubei_reserve_commission_percentage] 
                storeInfo.support_person_ali==1?support_person_ali='是':support_person_ali='否'
                storeInfo.support_person_koubei==1?support_person_koubei='是':support_person_koubei='否'
                that.info5=[
                    support_person_ali,
                    support_person_koubei,
                    "否"]     
                
            })
        }
    }
}
</script>
